package cn.kwq.project_manger.pojo.dto;

import cn.kwq.project_manger.pojo.Project;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "编辑项目请求对象")
public class UpdateProjDto {

    @ApiModelProperty(value = "项目id")
    private Long projectId;
    @ApiModelProperty(value = "项目标题（名字）")
    private String projectName;

    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;

//    private String tagId;

    /**
     * 比赛1项目0
     */
    @ApiModelProperty(value = "类型： 比赛1 项目0")
    private Integer type;

    /**
     * 学院类型 文0理1无要求2
     */
    @ApiModelProperty(value = "学院类型 文0理1无要求2")
    private Integer instituteType;

    /**
     * 发起活动的组织/部门
     */
    @ApiModelProperty(value = "发起活动的组织/部门")
    private String createDepartment;

    @ApiModelProperty(value = "专业限制（没有就不传）")
    private String  majorLimit;

    @ApiModelProperty(value = "标签")
    private List<String> tags;


    public Project getProject(){
        return
                Project.builder()
                        .projectId(this.projectId)
                        .projectName(this.projectName)
                        .majorLimit(this.majorLimit)
                        .createDepartment(this.createDepartment)
                        .type(this.type)
                        .instituteType(this.instituteType)
                        .startTime(this.startTime)
                        .endTime(this.endTime)
                        .build();
    }
}
